package day10;

public class Student extends Person{
    String nation;
    Student(String name, int age, String sex,String nation) {
        //super();

        super(name,age,sex);
        this.nation=nation;
    }

    void value(){
        super.value();
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                '}';
    }

    public static void main(String[] args) {
        Student s1 = new Student("nnn",10,"anan","lll");
        Student s2 = new Student("mmm",12,"mm","kkk");
        Student s3 = new Student("mmm",12,"mm","kkk");
        System.out.println(s1.toString());
        System.out.println(s2.toString());
        System.out.println(s1==s2);
        System.out.println(s2==s3);
        System.out.println(s2.equals(s3));
    }
}
